package cn.wolfcode.p2p.base.query;

import cn.wolfcode.p2p.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

@Getter@Setter
public class IpLogQuery extends QueryObject {
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date beginDate;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date endDate;
        private Integer state=-1;
        private String username;
        private Integer userType=-1;
        public String getUsername(){
                return StringUtils.hasLength(username)?username:null;
        }



        public Date getEndDate() {
                return DateUtil.getEndDate(endDate);
        }
}
